package java06;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

public class zy05 {
    public static void main(String[] args) {
        Integer[] arr1 = {1, 2, 3};
        Integer[] arr2 = {3, 4, 5, 2, 3};

        Set<Integer> set1 = Arrays.stream(arr1).collect(Collectors.toSet());
        Set<Integer> set2 = Arrays.stream(arr2).collect(Collectors.toSet());

        set1.removeAll(set2);
        set2.removeAll(Arrays.stream(arr1).collect(Collectors.toSet()));

        set1.addAll(set2);

        Integer[] result = set1.toArray(new Integer[0]);

        System.out.println(Arrays.toString(result));
    }
}
